import request from '@/utils/request'
import { ApiModulesRoutes } from '@/consts'

/**
 * @param {Object} paramVo
 * @param {Array<String>} paramVo?.abilityIds
 * @param {String} paramVo?.keyword
 * @param {Number} paramVo.pageNo
 * @param {Number} paramVo.pageSize
 * @return {Promise<AxiosResponse<any>>}
 */
export const apiFindAlgAbility = async(paramVo) => {
  const url = ApiModulesRoutes.BASE + '/alg/ability/findAlgAbility'
  return await request.post(url, paramVo)
}

/**
 * 查询算法能力
 * @param {String} abilityId 算法能力id
 * @return {Promise<AxiosResponse<any>>}
 */
export const apiFindAlgAbilityById = async(abilityId) => {
  const url = ApiModulesRoutes.BASE + '/alg/ability/findAlgAbilityById'
  return await request.get(url, { params: { abilityId } })
}

/**
 * 新增算法任务
 * @param {String} algTaskVo.algAbilityId 算法能力id
 * @param {String} algTaskVo?.algAbilityName 算法能力名
 * @param {String} algTaskVo.algOriginEnum 算法能力提供商
 * @param {String} algTaskVo.name 算法任务名
 */
export const apiAddAlgTask = async(algTaskVo) => {
  const url = ApiModulesRoutes.BASE + '/alg/task/addAlgTask'
  return await request.post(url, algTaskVo)
}
